intake and output calculation